import React, { Component } from 'react';
import { connect } from 'dva';
import { Map, Marker, NavigationControl, InfoWindow } from 'react-bmapgl';
import MapTypeControl from 'react-bmapgl/Control/MapTypeControl';
import ScaleControl from 'react-bmapgl/Control/ScaleControl';
import ZoomControl from 'react-bmapgl/Control/ZoomControl';
// import DragModal from '../components/DragModal';
import styles from './style/index.less';
@connect((state) =>
({
  test: state.gislogin.test
})
)
class BigMap extends Component {


  state = {
  }

  componentDidMount() {
    this.props.dispatch({
      type: 'map/getMapDetail',
      payload: {}
    })
  }

  handleClickMap = (e) => {
    const { latlng } = e;
    console.log(latlng);
  }

  handleOk = e => {
    console.log(e);
    this.setState({
      visible: false,
    });
  };

  handleCancel = e => {
    console.log(e);
    this.setState({
      visible: false,
    });
  };




  render() {
    return (
      <div className={styles.gigMap}>
        <Map
          enableScrollWheelZoom
          style={{ width: '100%', height: '100%' }}
          center={{ lng: 114.52096954505689, lat: 38.04340202826023 }}
          zoom="11"
          onClick={this.handleClickMap}
        >
          <MapTypeControl />
          <ScaleControl />
          <ZoomControl />
          <NavigationControl />
          <Marker position={{ lng: 114.52096954505689, lat: 38.04340202826023 }} />
          <InfoWindow position={{ lng: 114.52096954505689, lat: 38.04340202826023 }} text="内容" title="标题" />
        </Map >
        {/* <DragModal title={'333'}>
        </DragModal> */}
      </div >
    );
  }
}
export default BigMap;
